﻿using System;
using System.Collections.Generic;

namespace ProxyHero.Entity
{
    [Serializable]
    public class ConfigEntity
    {
        private int _readRssInterval;
        /// <summary>
        /// 读取RSS间隔
        /// </summary>
        public int ReadRssInterval
        {
            get { return _readRssInterval; }
            set { _readRssInterval = value; }
        }
        private TestEntity _defaultTestUrl = new TestEntity();
        /// <summary>
        /// 默认验证地址
        /// </summary>
        public TestEntity DefaultTestUrl
        {
            get { return _defaultTestUrl; }
            set { _defaultTestUrl = value; }
        }

        private  List<TestEntity> _testSetting = new List<TestEntity>();
        /// <summary>
        /// 验证设置
        /// </summary>
        public List<TestEntity> TestSetting
        {
            get
            {
                return _testSetting; 
            }
            set { _testSetting = value; }
        }

        private HttpSettingEntity _httpSetting;
        /// <summary>
        /// http设置
        /// </summary>
        public HttpSettingEntity HttpSetting
        {
            get { return _httpSetting; }
            set { _httpSetting = value; }
        }

        private bool isCooperation;

        /// <summary>
        /// 是否合作版
        /// </summary>
        public bool IsCooperation
        {
            get { return isCooperation; }
            set { isCooperation = value; }
        }

        private int testTimeOut = 10;

        /// <summary>
        /// 验证超时，单位毫秒
        /// </summary>
        public int TestTimeOut
        {
            get { return testTimeOut; }
            set { testTimeOut = value; }
        }
        private int autoChangeProxyInterval = 10;

        /// <summary>
        /// 自动切换代理时间间隔，单位分钟
        /// </summary>
        public int AutoChangeProxyInterval
        {
            get { return autoChangeProxyInterval; }
            set { autoChangeProxyInterval = value; }
        }

        private int autoProxySpeed = 10;
        /// <summary>
        /// 自动代理速度
        /// </summary>
        public int AutoProxySpeed
        {
            get { return autoProxySpeed; }
            set { autoProxySpeed = value; }
        }

        private int testThreadsCount = 10;
        /// <summary>
        /// 验证线程数
        /// </summary>
        public int TestThreadsCount
        {
            get { return testThreadsCount; }
            set { testThreadsCount = value; }
        }

        private string defaultStartPage = "rss";

        /// <summary>
        /// 默认起始页
        /// </summary>
        public string DefaultStartPage
        {
            get { return defaultStartPage; }
            set { defaultStartPage = value; }
        }

        private bool checkAnonymous = false;

        /// <summary>
        /// 是否验证代理匿名度
        /// </summary>
        public bool CheckAnonymous
        {
            get { return checkAnonymous; }
            set { checkAnonymous = value; }
        }

    }
    [Serializable]
    public class TestEntity
    {
        private string _testUrl = "http://www.baidu.com";
        /// <summary>
        /// 验证网站地址
        /// </summary>
        public string TestUrl
        {
            get { return _testUrl; }
            set { _testUrl = value; }
        }

        private string _testWebTitle = "百度";
        /// <summary>
        /// 验证网站Title
        /// </summary>
        public string TestWebTitle
        {
            get { return _testWebTitle; }
            set { _testWebTitle = value; }
        }

        private string _testWebEncoding = "GB2312";

        public string TestWebEncoding
        {
            get { return _testWebEncoding; }
            set { _testWebEncoding = value; }
        }
    }
}
